#ifndef TRACK_H
#define	TRACK_H

#include <list>
#include "event.h"

namespace MidiFile {

class MIDIFILE_DLL Track {
public:

    Track() : nBytes(0), nTicks(0), iterator(events.begin())
    {
    }
    Track(std::ifstream &file) throw (FileException, std::bad_alloc);
    Track(const Track &other) throw (std::bad_alloc);
    ~Track() throw ();

    inline unsigned int getNumBytes() const throw ()
    {
        return nBytes;
    }

    inline unsigned int getNumTicks() const throw ()
    {
        return nTicks;
    }

    Event & getNextEvent() throw (InvalidException);

    void read(std::ifstream &file) throw (FileException, std::bad_alloc);

private:
    unsigned int nBytes;
    unsigned int nTicks;
    std::list<Event*> events;
    std::list<Event*>::iterator iterator;
};
}

#endif	/* TRACK_H */
